//
//  alertVC.m
//  Notification
//
//  Created by Apple on 2017/3/22.
//  Copyright © 2017年 Apple. All rights reserved.
//

#import "alertVC.h"
#import "HongFile.pch"
@interface alertVC ()

@end

@implementation alertVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"AlertVC";
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.but = [UIButton buttonWithType:UIButtonTypeCustom];
    self.but.frame = CGRectMake(SCREEN_WIDTH/2-50, SCREEN_HEIGHT/2-50, 100, 100);
    self.but.layer.borderWidth = 1;
    self.but.layer.borderColor = [UIColor redColor].CGColor;
    [self.but setTitle:@"Click" forState:UIControlStateNormal];
    [self.but setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [self.but addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.but];

    // Do any additional setup after loading the view.
}
-(void)buttonClick:(UIButton*)button{
    UIAlertController*alert = [UIAlertController alertControllerWithTitle:@"警告" message:@"您的余额不足!" preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction * queding = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        
    }];
    UIAlertAction * que = [UIAlertAction actionWithTitle:@"??" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        
    }];
    UIAlertAction*quxiao = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
        [self.navigationController popViewControllerAnimated:YES];
    }];
    [alert addAction:que];
    [alert addAction:queding];
    [alert addAction:quxiao];
    [self presentViewController:alert animated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
